package org.blogwu.learn.multithread.chapter3.demo18.v1;

public class Mian3 {

    static ThreadLocal<String> threadLocal = ThreadLocal.withInitial(() -> "Hello");

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            threadLocal.set("SB");
            try {
                Thread.sleep(8000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(threadLocal.get());
        });

        t1.start();
        Thread.sleep(2000);

        System.gc();
    }

}
